<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Search RPM packages</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.rpmdbinfo.html">« rpmdbinfo</a></li>
      <li style="float: right;"><a href="function.rpminfo.html">rpminfo »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.rpminfo.html">RpmInfo 函数</a></li>
    <li>Search RPM packages</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.rpmdbsearch" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">rpmdbsearch</h1>
  <p class="verinfo">(PECL rpminfo &gt;= 0.3.0)</p><p class="refpurpose"><span class="refname">rpmdbsearch</span> &mdash; <span class="dc-title">Search RPM packages</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.rpmdbsearch-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>rpmdbsearch</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$pattern</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$rpmtag</code><span class="initializer"> = RPMTAG_NAME</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$rpmmire</code><span class="initializer"> = -1</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">bool</span> <code class="parameter">$full</code><span class="initializer"> = <strong><code>false</code></strong></span></span><br>): <span class="type">array</span></div>

  <p class="para rdfs-comment">
   Search packages in the system RPM database.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.rpmdbsearch-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">pattern</code></dt>

    <dd>

     <p class="para">
      Value to search for.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">rpmtag</code></dt>

    <dd>

     <p class="para">
      Search criterion, one of RPMTAG_* constant, see the <a href="rpminfo.constants.html" class="link">rpminfo constants</a> page.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">rpmmire</code></dt>

    <dd>

     <p class="para">
      Pattern type, one of RPMMIRE_* constant, see the <a href="rpminfo.constants.html" class="link">rpminfo constants</a> page.
      When &lt; 0 the criterion must equals the value, and database index is used if possible.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">full</code></dt>

    <dd>

     <p class="para">
      If <strong><code>true</code></strong> all information headers for the file are retrieved, else only a minimal set.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.rpmdbsearch-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   An <span class="type">array</span> of <span class="type">array</span> of information or NULL on error.   
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.rpmdbsearch-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3188">
    <p><strong>示例 #1 Searching for the package owning a file</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">rpmdbsearch</span><span style="color: #007700">(</span><span style="color: #DD0000">"/usr/bin/php"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">RPMTAG_INSTFILENAMES</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; Array
        (
            [Name] =&gt; php-cli
            [Version] =&gt; 7.4.4
            [Release] =&gt; 1.fc32
            [Summary] =&gt; Command-line interface for PHP
            [Arch] =&gt; x86_64
        )

)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.rpmdbsearch-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.rpmaddtag.html" class="function" rel="rdfs-seeAlso">rpmaddtag()</a> - Add tag retrieved in query</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>